/*
 * @Description: `
 * @Date: 2022-08-08 14:32:11
 * @LastEditors: Zzt
 * @LastEditTime: 2022-08-09 13:38:32
 */

import request from '@/utils/request';

export interface IQueryList {
  createTime?: string;
  execEndTime?: string;
  execRecordJson?: string;
  execStartTime?: string;
  id?: number;
  operator?: number;
  operatorName?: string;
  operatorTime?: string;
  planCode?: string;
  planEndTime?: string;
  planStartTime?: string;
  planTime?: string;
  planTitle?: string;
  status?: number;
}
// 分页鉴定与处置列表
export function planList(data: IQueryList) {
  return request({
    url: `/disposal-plan/list`,
    method: 'post',
    data
  });
}

export interface ICreateDisposal {
  id?: number;
  attachment?: string;
  execEndTime?: string;
  execRecordJson?: string;
  execStartTime?: string;
  planCode?: string;
  planContent?: string;
  planEndTime?: string;
  planStartTime?: string;
  planTime?: string;
  planTitle?: string;
  status?: number;
}
// 新增处置计划
export function createDisposal(data: ICreateDisposal) {
  return request({
    url: `/disposal-plan/`,
    method: 'post',
    data
  });
}

// 删除计划
export function deleteAppAndDis(id: number | string) {
  return request({
    url: `/disposal-plan/${id}`,
    method: 'delete'
  });
}
export interface IEditDisposal {
  id?: number;
  createTime?: string;
  ICreateDisposal: ICreateDisposal;
}
// 修改计划
export function editAppAndDis(data: IEditDisposal) {
  // console.log(data);
  return request({
    url: `disposal-plan/`,
    method: 'put',
    data
  });
}
